﻿<local:BaseLab x:Class="Rxx.Labs.Reactive.UI.EventSubscriptionTriggerLab"
							 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
							 xmlns:local="clr-namespace:Rxx.Labs"
							 xmlns:rxx="clr-namespace:System.Windows.Reactive;assembly=Rxx"
							 xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
							 xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
							 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
							 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
							 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
							 mc:Ignorable="d"
							 d:DesignHeight="300" d:DesignWidth="700"
							 DataContext="{Binding RelativeSource={RelativeSource Self}}">

	<toolkit:DockPanel>

		<Border toolkit:DockPanel.Dock="Top" BorderBrush="Blue" BorderThickness="2" CornerRadius="15"
						Margin="10" Padding="5">
			<StackPanel>
				<TextBlock Text="{Binding Preview}" Margin="5,10" FontSize="14" TextWrapping="Wrap" Foreground="Gray" />
				<TextBlock Text="{Binding Details}" Margin="5,10" FontSize="14" TextWrapping="Wrap" />
			</StackPanel>
		</Border>

		<ListBox ItemsSource="{Binding Items}" DisplayMemberPath="FirstAttribute.Value">
			<interactivity:Interaction.Triggers>
				<rxx:EventSubscription EventName="MouseMove" Handler="{Binding ShowItemPreview}" />
				<rxx:EventSubscription EventName="MouseLeftButtonUp" Handler="{Binding ShowItemDetails}" />
				<rxx:EventSubscription EventName="MouseRightButtonDown" Handler="{Binding ResetItemDetails}" />
			</interactivity:Interaction.Triggers>
		</ListBox>

	</toolkit:DockPanel>

</local:BaseLab>